<template>
	<div class="export-dialog-view" v-loading="pageLoading">
		<div class="export-dialog">
			<div class="left-lay">
				<div class="split-title">{{ title }}</div>
				<div class="left-line">
					<div class="line-title">
						{{ $t("message.bhView.leftComponents.device") }}
					</div>
					<div class="line-value">{{ $store.state.plantName }}</div>
				</div>

				<div class="left-line">
					<div class="line-title">
						{{ $t("message.bhView.leftComponents.object") }}
					</div>
					<div class="line-value">
						－
					</div>
				</div>

				<div class="left-line">
					<div class="line-title">
						{{ $t("message.reportFrom.exportDialog.title_c") }}
					</div>
					<div class="line-value">{{ fileTypeStr }}</div>
				</div>

				<div class="left-draw" id="left-draw"></div>
			</div>

			<div class="tip-lay"></div>

			<div class="right-lay">
				<div class="split-title text-right">
					<i class="el-icon-close" @click="CloseExprotDiloag"></i>
				</div>
				<div class="split-title">
					{{ $t("message.reportFrom.exportDialog.title_l") }}
				</div>
				<div class="right-line">
					<div class="line-title">
						{{ $t('message.ReportFormTable.A_C.lab1') }}
					</div>
					<div class="line-content">
						<el-select v-model="color" placeholder="请选择" class="ipt picker">
							<el-option v-for="(item, index) in colorList" :key="index" :label="item.label"
								:value="item.key">
							</el-option>
						</el-select>
					</div>
					<div id="right-CAD"></div>
				</div>
			</div>
			<footer class="footer-view">
				<div class="">
					<div class="line-title" style="width: 100%">
						{{ $t("message.reportFrom.exportDialog.tip") }}
					</div>
				</div>
				<div>
					<el-button @click="CloseExprotDiloag">Cancel</el-button>
					<el-button type="primary" @click="onExportClick">OK</el-button>
				</div>
			</footer>
		</div>
	</div>
</template>

<script>
import {
	getPFD,
	getReadCorrosionThckData,
	getReadSurplusLifeData,
	getCorrColorData,

	ExPFDDrawReportCombox,
	ExPFDDrawReport,
	CollectFiles
} from "@/api/api";
import * as svg_opt from "@/utils/svg_opt.js";
import { async } from "q";
import { getLocalStorage } from "@/utils/storage";

export default {
	props: ["title", "fileTypeStr", "selectMacData", "fileRadio"],
	name: "A_C_Export",
	data() {
		return {
			pageLoading: false,
			colorList: [],
			color: '',

			leftReadTabelRow: [],
			colorOptionsValue: 206,

			legendData: {
				// legendSig: "",
				legendArray: []
			},
			colorVal: [],
			tarList: [],
			cachedReDatas: [],
			state: true,
			svgSourceUrl: '',
			svgSourceUrl1: '',
		};
	},
	components: {},
	watch: {},
	methods: {
		CloseExprotDiloag() { this.$emit("CloseExprotDiloag"); },
		changeWait(e) {
			this.state = e;
		},
		wait() {
			return new Promise((resolve, reject) => {
				if (this.state) {
					resolve();
				} else {
					const intervalId = setInterval(() => {
						if (this.state) {
							clearInterval(intervalId);
							resolve();
						}
					}, 500);
				}
			});
		},
		async onExportClick() {
			let pfdArr = [];
			let colorItem = this.colorList.find(item => item.key == this.color);

			for (let index = 0; index < this.selectMacData.length; index++) {
				this.pageLoading = true;

				this.leftReadTabelRow = this.selectMacData[index];
				if (!this.leftReadTabelRow.pdfFile) {
					// this.pageLoading = false;
					let dataJson = {
						PltCode: this.leftReadTabelRow.pltCode,//	是	int	装置Code
						Color: colorItem.key,//	是	int	色种Code
						ColorName: colorItem.label,//	是	string	色种名称
						SvgHtml: "",//	string	svg字符串
						ProCodeList: this.leftReadTabelRow.proCode,//	是	List<string>	PFD Code
						ProName: this.leftReadTabelRow.proName,//	是	string	处理系名称
					}
					let res = await ExPFDDrawReport(dataJson);
					pfdArr.push(res.data.data)
					continue;
				}
				this.requireSvgData(this.leftReadTabelRow.pdfFile, this.leftReadTabelRow.proPass);
				this.state = false;
				await this.wait();
				// svgHtmls[i.macCode] = await this.$refs.cadViewForBH.exportSvgDataStr();


				let tar = await svg_opt.exportSvgDataStr();
				let dataJson = {
					PltCode: this.leftReadTabelRow.pltCode,//	是	int	装置Code
					Color: colorItem.key,//	是	int	色种Code
					ColorName: colorItem.label,//	是	string	色种名称
					SvgHtml: tar,//	string	svg字符串
					ProCodeList: this.leftReadTabelRow.proCode,//	是	List<string>	PFD Code
					ProName: this.leftReadTabelRow.proName,//	是	string	处理系名称
				}
				let res = await ExPFDDrawReport(dataJson);
				pfdArr.push(res.data.data)
			}


			if (pfdArr.length == 1) {
				window.open(pfdArr[0]);
				this.pageLoading = false;
				this.$emit("CloseExprotDiloag");
				return
			} else if (pfdArr.length != 0) {
				let zipRe = await CollectFiles({
					pdfList: pfdArr,
				}).catch((err) => {
					console.log(err)
					return {
						data: {
							code: -1,
						},
					};
				});

				if (zipRe.data.code == 0) {
					this.$emit("CloseExprotDiloag");
					window.open(zipRe.data.data);
				} else {

					this.$alert(zipRe.data.msg, '', {
						confirmButtonText: 'OK',
						type: 'warning',
					});
				}
				this.pageLoading = false;
				this.$emit("CloseExprotDiloag");
			}


		},
		async ExportFn(index) {
			let colorItem = this.colorList.find(item => item.key == this.color);

			// this.leftReadTabelRow = this.selectMacData[index];
			// this.requireSvgData(this.leftReadTabelRow.pdfFile);
			// if (colorItem.key != 0) {
			// 	let colorVal = await this.getCorrColorDataApi(colorItem.key.toString())
			// 	this.legendList(colorVal);
			// } else {
			// 	// this.legendList([]);
			// }
			let tar = svg_opt.exportSvgDataStr();
			let dataJson = {
				PltCode: this.leftReadTabelRow.pltCode,//	是	int	装置Code
				Color: colorItem.key,//	是	int	色种Code
				ColorName: colorItem.label,//	是	string	色种名称
				SvgHtml: tar,//	string	svg字符串
				ProCodeList: this.leftReadTabelRow.proCode,//	是	List<string>	PFD Code
				ProName: this.leftReadTabelRow.proName,//	是	string	处理系名称
			}
			let res = await ExPFDDrawReport(dataJson);
			console.log(res)
			this.cachedReDatas.push(res.data.data)
			if (this.selectMacData.length == 1) {
				window.open(this.cachedReDatas[0]);
				this.pageLoading = false;
				this.$emit("CloseExprotDiloag");
			} else if (this.cachedReDatas.length == this.selectMacData.length) {
				console.log(this.cachedReDatas)
				let zipRe = await CollectFiles({
					pdfList: this.cachedReDatas,
				}).catch((err) => {
					console.log(err)
					return {
						data: {
							code: -1,
						},
					};
				});

				if (zipRe.data.code == 0) {
					this.$emit("CloseExprotDiloag");
					window.open(zipRe.data.data);
				} else {
					this.$alert(zipRe.data.msg, '', {
						confirmButtonText: 'OK',
						type: 'warning',
					});

				}
				this.pageLoading = false;
				this.$emit("CloseExprotDiloag");
			}
		},

		setDefaultSelectLineGroup(isForce = false) {
			let temp = null;
			if (isForce) {
				temp = {
					linNumb1: this.defaultSelectLinNumb,
					prlNo: this.defaultSelectLinNumb
				};
			} else if (this.selectLineGroupData) {
				temp = this.selectLineGroupData;
			} else if (this.defaultSelectLinNumb >= 0) {
				temp = {
					linNumb1: this.defaultSelectLinNumb,
					prlNo: this.defaultSelectLinNumb
				};
			} else if (this.defaultSelectLinNumb == -1) {
				temp = {
					linNumb1: this.pfdData[0].prlNo,
					prlNo: this.pfdData[0].prlNo
				};
			} else {
				// 不做任何操作 返回阅览  没有査到対应的线组
				temp = {
					linNumb1: this.pfdData[0].prlNo,
					prlNo: this.pfdData[0].prlNo
				};
			}

			if (temp != null) {
				this.onTableItemSelect(temp);
				if (!isForce) this.onLineGroupSelect(temp);
			} else {
				if (this.$store.state.rdStyleCode == 3)
					// 图纸页面弹出提示
					this.$alert(this.$t("message.reading.nullSelectTip"), '', {
						confirmButtonText: 'OK',
						type: 'warning',
					});
			}
			this.P = new Promise((resolve, reject) => {
				resolve('OK');
			});
			//着色完成，拿到svg

		},

		//获取图纸球标等颜色信息
		async getCorrColorDataApi(colorOptionsValue) {
			let dataJson = {
				corrCode: colorOptionsValue || '206',
			};
			let res = await getCorrColorData(dataJson);
			this.colorVal = [];
			if (res.data.code != 0) {
				return;
			}
			return res.data.data;
		},
		/**
	 * 加载svg图纸 svg格式正常加载  位图格式先加载基础svg 在onSvgLoaded替换位图
	 */
		async requireSvgData(inSourceUrl, originFileName) {
			if (inSourceUrl == null || typeof inSourceUrl == "undefined") {
				svg_opt.removeSvg();
				return;
			}

			let num = inSourceUrl.lastIndexOf(".") + 1;
			this.sourceExt = inSourceUrl.substring(num);
			this.sourceUrl = inSourceUrl;
			this.svgSourceUrl1 = inSourceUrl;

			let EXT = this.sourceExt
			if (
				EXT == "png" ||
				EXT == "jpg" ||
				EXT == "gif" ||
				EXT == "bmp" ||
				EXT == "jpeg" ||
				EXT == "tif" ||
				EXT == "tiff"
			) {
				this.isSourcePic = true;
				this.svgSourceUrl = require("@/assets/model/method-draw-image.svg");
			} else {
				this.isSourcePic = false;
				this.svgSourceUrl = inSourceUrl;
			}

			this.loadSvg(originFileName);
		},
		legendList(val, colorKey) {

			// legendData
			if (val.length == 0) {
				// this.legendData.legendSig = "";
				this.clearLineGroupColor();
				this.legendData.legendArray = [];
				return;
			}

			let sig = val[0].judg_sig;
			// this.legendData.legendSig = sig;

			let isUp = true;
			if (sig == "≦" || sig == "＜" || sig == "<=" || sig == "<") isUp = true;
			else if (sig == "≧" || sig == "＞" || sig == ">=" || sig == ">")
				isUp = false;

			let legendArray = JSON.parse(JSON.stringify(val));

			legendArray.sort((a, b) => {
				if (isUp) a.judg_crr - b.judg_crr;
				else b.judg_crr - a.judg_crr;
			});
			this.legendData.legendArray = legendArray;
			setTimeout(() => {
				this.state = true;
			}, 500);
			if (colorKey == 206 || colorKey == 667) {
				console.log(111);
				this.requireReadCorrosionThckData();

				return
			}
			if (colorKey == 215) {
				console.log(222);
				this.requireReadSurplusLifeData();
				return
			}
			if (colorKey == 0) {
				console.log(333);
				this.clearLineGroupColor();
				return
			}
		},
		/**
		 * 获取线组数据
		 */
		requirePfdData() {
			let dataJson = {
				proCode: this.leftReadTabelRow.proCode,
				pltCode: this.leftReadTabelRow.pltCode,
				Account: getLocalStorage("userName"),
				// Type: 1
			};
			getPFD(dataJson).then(res => {
				console.log(res, "ssssssssssssss");
				if (res.data.code != 0) {
					// return;
				}
				let tempData = res.data.data;
				this.pfdData = this.genLineGroupAndShow(tempData);
				// svg_opt.testAddLineGroupsByParams(this.pfdData);
				// svg_opt.clearAllMarkups();
				// svg_opt.testAddLineGroupsByParams(this.pfdData);
				// this.requireReadCorrosionThckData();


				setTimeout(async () => {
					let colorItem = this.colorList.find(item => item.key == this.color);
					// 选中的下拉框
					console.log('colorItem', colorItem);
					let colorVal = await this.getCorrColorDataApi(colorItem.key.toString())
					// 规则
					console.log('colorVal', colorVal);
					// 渲染？

					try {
						if (colorItem.key != 0) {
							this.legendList(colorVal, colorItem.key.toString());
						} else {
							this.state = true;
						}
					} catch (error) {
						this.state = true;
					}
				}, 500);
			});
		},

		/**
		 * 余寿命着色数据
		 */
		requireReadSurplusLifeData() {

			let dataJson = {
				proCode: this.leftReadTabelRow.proCode,
				pltCode: this.leftReadTabelRow.pltCode,
				pageIndex: 1,
				pageSize: 1000
			};
			getReadSurplusLifeData(dataJson).then(res => {
				console.log(res, "5555555555555");
				if (res.data.code != 0) {
					return;
				}
				let tempData = res.data.data;
				tempData.forEach(element => {
					element.linNumb = element.liN_NUMB;
					element.macMax = element.yer;
				});
				this.updateLineGroupAndShowByMacMax(tempData);
				// this.requireSelectLineGroup();
				this.setDefaultSelectLineGroup();
			});
		},

		/**
		 * 腐蚀率、餐肉厚着色数据
		 */
		requireReadCorrosionThckData() {
			let dataJson = {
				type:
					this.color == 206
						? 1
						: this.color == 667
							? 2
							: 1,
				proCode: this.leftReadTabelRow.proCode,
				pltCode: this.leftReadTabelRow.pltCode,
				pageIndex: 1,
				pageSize: 1000
			};

			getReadCorrosionThckData(dataJson).then(res => {
				console.log(res, "22222222222222");
				if (res.data.code != 0) {
					this.updateLineGroupAndShowByMacMax([]);
					// this.requireSelectLineGroup();
					this.setDefaultSelectLineGroup();
					return;
				}
				let tempData = res.data.data;
				this.updateLineGroupAndShowByMacMax(tempData);
				// this.requireSelectLineGroup();
				this.setDefaultSelectLineGroup();
			});
		},



		genLineGroupAndShow(originData) {
			let lineGroups = [];
			let lastPrl = "";

			// 遍历节点
			for (let i = 0; i < originData.length; i++) {
				//   debugger
				let tempData = originData[i];
				let tempLineGroup = null;

				// 如果当前节点与上一个节点的线组号不同，新建线组，压入线组list
				if (lastPrl != tempData.prlNo) {
					tempLineGroup = {};
					lineGroups.push(tempLineGroup);

					tempLineGroup.defaultLineColor = "#0000ff11";
					tempLineGroup.defaultLineWidth = "10";
					tempLineGroup.prlNo = tempData.prlNo;
					tempLineGroup.groupItems = [];
					tempLineGroup.sId = tempData.prlNo;
					tempLineGroup.fEntType = 17;
					// tempLineGroup.text = "111111";
				}

				// 取最近一个线组
				tempLineGroup = lineGroups[lineGroups.length - 1];

				// 如果线组为空 根据当前节点创建
				if (
					tempLineGroup.groupItems.length == 0 ||
					tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1].dtlNo !=
					tempData.dtlNo
				) {
					let newItem = {};
					newItem.dtlNo = tempData.dtlNo;
					newItem.shapeType =
						tempData.prlType == 1
							? "line"
							: tempData.prlType == 2
								? "closeline"
								: "rect";
					newItem.fEntType = "17";
					newItem.text = tempData.title.split("_")[0];
					newItem.points = [];
					if (this.isSourcePic) {
						newItem.points.push({ x: tempData.prlX, y: 0 - Math.abs(tempData.prlY) });
					} else {
						newItem.points.push({ x: tempData.prlX, y: tempData.prlY });
					}
					tempLineGroup.groupItems.push(newItem);
				} else if (
					tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1].dtlNo ==
					tempData.dtlNo &&
					tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1].points
						.length >= 2
				) {
					let newItem = {};
					newItem.dtlNo = tempData.dtlNo;
					newItem.shapeType =
						tempData.prlType == 1
							? "line"
							: tempData.prlType == 2
								? "closeline"
								: "rect";
					newItem.fEntType = "17";
					// newItem.text = "33333";
					newItem.points = [];

					newItem.points.push(
						tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1]
							.points[
						tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1]
							.points.length - 1
						]
					);

					if (this.isSourcePic) {
						newItem.points.push({ x: tempData.prlX, y: 0 - Math.abs(tempData.prlY) });
					} else {
						newItem.points.push({ x: tempData.prlX, y: tempData.prlY });
					}
					tempLineGroup.groupItems.push(newItem);
				} else if (
					tempLineGroup.groupItems[tempLineGroup.groupItems.length - 1].dtlNo ==
					tempData.dtlNo
				) {
					if (this.isSourcePic) {
						// newItem.points.push({ x: tempData.prlX, y: 0 - Math.abs(tempData.prlY) });
						tempLineGroup.groupItems[
							tempLineGroup.groupItems.length - 1
						].points.push({ x: tempData.prlX, y: 0 - Math.abs(tempData.prlY) });
					} else {
						// newItem.points.push({ x: tempData.prlX, y: tempData.prlY });
						tempLineGroup.groupItems[
							tempLineGroup.groupItems.length - 1
						].points.push({ x: tempData.prlX, y: tempData.prlY });
					}
					// tempLineGroup.groupItems[
					//   tempLineGroup.groupItems.length - 1
					// ].points.push({ x: tempData.prlX, y: tempData.prlY });
				}

				lastPrl = tempLineGroup.prlNo;
			}

			console.log(lineGroups);
			return lineGroups;
		},


		/**
		 * 清空线组颜色、清空图纸上的markup、重新绘制线组
		 */
		clearLineGroupColor() {
			this.pfdData.forEach(element => {
				element.defaultLineColor = "#0000ff11";
			});
			svg_opt.clearAllMarkups();
			// debugger
			console.log(this.pfdData)
			svg_opt.testAddLineGroupsByParams(this.pfdData);
			if (this.selectLineGroupData)
				svg_opt.changeSelectStatusById(this.selectLineGroupData.prlNo);
		},

		/**
		 * 更新线组颜色数据
		 */
		updateLineGroupAndShowByMacMax(corrosData) {
			var corrosDataMap = corrosData.map(function (o) {
				return o.linNumb;
			});
			// console.log(corrosDataMap)
			for (let i = 0; i < this.pfdData.length; i++) {
				let lineGroupPrlNo = this.pfdData[i].prlNo;
				let corrosIndex = corrosDataMap.indexOf(lineGroupPrlNo);
				if (corrosIndex == -1) {
					this.pfdData[i].defaultLineColor = (this.legendData.legendArray == 0 && !this.$store.state.btn_set_BHView && this.$parent.$options.name == "Reading") ? "#FF7F27" : "#ff000011";
					continue;
				}

				// debugger
				let corrosItem = corrosData[corrosIndex];
				this.genLineGroupColor(this.pfdData[i], corrosItem);
			}

			console.log(this.pfdData);
			svg_opt.clearAllMarkups();
			svg_opt.testAddLineGroupsByParams(this.pfdData);
			if (this.selectLineGroupData)
				svg_opt.changeSelectStatusById(this.selectLineGroupData.prlNo);
		},

		/**
		 * 根据着色数据为线组上色
		 */
		genLineGroupColor(inLineGroup, inCorrosItem) {
			// if (sig == "≦" || sig == "＜" || sig == "<="  || sig == "<" ) isUp = true;
			// else if( sig == "≧" || sig == "＞" || sig == ">="  || sig == ">") isUp = false;

			//       legendData: {
			//   legendSig: "",
			//   legendArray: [],
			// },
			// debugger
			for (let i = 0; i < this.legendData.legendArray.length; i++) {
				let tempValue = this.legendData.legendArray[i].judg_crr;
				let tempSig = this.legendData.legendArray[i].judg_sig;

				if (
					(tempSig == "≦" || tempSig == "<=") &&
					inCorrosItem.macMax <= tempValue
				) {
					inLineGroup.defaultLineColor = this.legendData.legendArray[i].color;
					return;
				} else if (
					(tempSig == "＜" || tempSig == "<") &&
					inCorrosItem.macMax < tempValue
				) {
					inLineGroup.defaultLineColor = this.legendData.legendArray[i].color;
					return;
				} else if (
					(tempSig == "≧" || tempSig == ">=") &&
					inCorrosItem.macMax >= tempValue
				) {
					inLineGroup.defaultLineColor = this.legendData.legendArray[i].color;
					return;
				} else if (
					(tempSig == "＞" || tempSig == ">") &&
					inCorrosItem.macMax > tempValue
				) {
					inLineGroup.defaultLineColor = this.legendData.legendArray[i].color;
					return;
				} else {
					inLineGroup.defaultLineColor = "#ff000011";
				}
			}
		},

		loadSvg(originFileName) {
			if (!this.svgSourceUrl || this.svgSourceUrl == "") {
				svg_opt.removeSvg();
				return;
			}

			if (this.isSvgLoading) return;

			this.isSvgLoading = true;
			svg_opt.setSvgLineWidthRatio(1.5);
			svg_opt.setSvgBoundingBoxRatio(0, 0, 1);
			// svg_opt.setSvgBoundingBoxRatio(0, -140, 1);
			// svg_opt.setCanClickSelectMarkup(true,[1,2,3,4,5,6,7,8,9,10,11,12]);
			svg_opt.setCanClickSelectMarkup(true);

			svg_opt.setCanEditSelectMarkup(false);
			svg_opt.setCanFitPositionAndScale(false);
			svg_opt.setEditDotWidthRatio(3);
			svg_opt.setSelectCallBack(this.onLineGroupSelect);
			let num = originFileName.lastIndexOf(".") + 1;
			var originExt = originFileName.substring(num);
			svg_opt.AddSvg(this.svgSourceUrl, "right-CAD", this.onSvgMousePosChange, true,
					0,
					0,
					originExt == "wmf" ? 1 : -1);
			svg_opt.SetSvgMouseMode(0);
			svg_opt.setLoadCallBack(this.onSvgLoaded);
			svg_opt.setLeftMouseClickFun(() => {
				this.contextMenuVisible = false;
				// svg_opt.clearSelectedState();
			});
		},

		onSvgMousePosChange(posX, posY) {
			// console.log("onSvgMousePosChange " + posX + " " + posY);
			// console.log($("rect"))
			// $("#g-markupundefined").on("mouseenter", ()=>{
			//   console.log("1111111")
			// })
		},

		onSvgLoaded(error) {
			console.log("onSvgLoaded --- ", error);
			this.isSvgLoading = false;
			if (error) {
				console.log(error);
				return;
			}

			this.isSvgLoaded = true;

			if (this.isSourcePic) {
				svg_opt.changeSvgElementData({
					tagName: "img-content",
					paramName: "xlink:href",
					newValue: this.svgSourceUrl1,
					isReport: true
				});
			}

			this.requirePfdData();

		},

		onTestClick() {
			// svg_opt.testAddLineGroupsByParams(test_linegroup);
			console.log("onTestClick");
		},

		/**
		 * 判断右键菜单是否显示
		 * 有选中线组，显示
		 * 无选中线组：不显示
		 */
		updateContextMenuShow(inShow) {
			console.log("updateShow(inShow)" + inShow);
			if (this.selectLineGroupData != null) this.contextMenuVisible = inShow;
			else this.contextMenuVisible = false;
		},

		/**
		 * 线组选中
		 */
		onLineGroupSelect(e) {
			//       if (e == null) return;
			console.log(e)
			this.selectLineGroupData = e;
			// eventBus.$emit("pfdRelationSelectTableRow", e);
			this.$emit("onLineGroupClick", e)
		},

		/**
		 * 右键菜单
		 */
		onContextMenuClick(e) {
			this.contextMenuVisible = false;
			if (e.tag == "fit-draw") {
				svg_opt.ResetSvgView();
			} else if (
				e.tag == "bh-reading" ||
				e.tag == "check-result" ||
				e.tag == "draw-style"
			) {
				this.$emit("onCadContextMenuClick", {
					prlNo: this.selectLineGroupData.prlNo,
					tag: e.tag
				});
			} else {
				this.$message({
					message: e.menuText,
					type: "info"
				});
			}
		},

		/**
		 * 表格选中
		 */
		onTableItemSelect(e) {
			console.log(e.linNumb1 || e.prlNo);
			svg_opt.changeSelectStatusById(e.linNumb1 || e.prlNo);
			// this.selectLineGroupData
			this.pfdData.forEach(element => {
				if (element.prlNo == e.linNumb1 || element.prlNo == e.prlNo) {
					this.selectLineGroupData = element;
					return;
				}
			});
		},

		/**
		 * 获取选中线组的线组号
		 */
		getSelectLineGroupPrlNo() {
			if (this.selectLineGroupData) return this.selectLineGroupData.prlNo;
			return null;
		},

		//获取下拉框
		async ExPFDDrawReportComboxApi() {
			let res = await ExPFDDrawReportCombox();
			this.colorList = res.data.data.colorLst;
			this.color = this.colorList[0].label
			console.log(this.colorList)
		}
	},
	created() {
		// this.leftReadTabelRow = this.selectMacData[0];

	},
	mounted() {
		this.ExPFDDrawReportComboxApi();
		// console.log(this.selectMacData)
		// this.requireSvgData(
		// 	this.selectMacData[0].pdfFile
		// );
	},
	beforeDestroy() { },
	destroyed() { },
};
</script>
<style lang="scss" scoped>
.export-dialog-view {
	position: fixed;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	z-index: 6;
}

.export-dialog {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 712px;
	height: 280px;
	// height: 292px;
	background: #ffffff;
	box-shadow: 0px 12px 48px 16px rgba(0, 0, 0, 0.05),
		0px 9px 28px 0px rgba(0, 0, 0, 0.08),
		0px 6px 16px -8px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: row;
	padding: 0 12px;
}

.left-lay {
	position: relative;
	width: 40%;
	height: 100%;
	// border-right: 1px solid #ccc;
	display: flex;
	flex-direction: column;
	// background-color: blanchedalmond;

	.left-line {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 0px 20px;
		padding-top: 10px;

		.line-title {
			font-size: 14px;
			font-weight: 700;
			color: rgba(0, 0, 0, 0.85);
			line-height: 22px;
		}

		.line-value {
			font-size: 14px;
			font-weight: 400;
			color: #7b7b7b;
			line-height: 22px;
			margin-left: 10px;
		}
	}

	.left-draw {
		position: absolute;
		top: 100vh;
		width: 750px;
		height: 611px;
		// flex-grow: 1;
		// flex-shrink: 1;
		background-color: bisque;
	}
}

.tip-lay {
	background: red;
	width: 7px;
	border-radius: 4px;
	background: #ccc;
	margin-top: 46px;
	margin: 46px 15px 85px 15px;
}

.right-lay {
	position: relative;
	width: 60%;
	height: 100%;
	display: flex;
	flex-direction: column;

	.el-icon-close {
		font-size: 16px;
		cursor: pointer;
		width: 46px;
		height: 45px;
		line-height: 45px;
	}

	.right-block-container {
		width: 100%;
		display: flex;
		flex-direction: column;
	}

	.text-right {
		padding: 0 !important;
		text-align: right;
	}

	.right-line {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 0px 12px;
		padding-top: 10px;

		.line-title {
			font-size: 14px;
			font-weight: 700;
			color: rgba(0, 0, 0, 0.85);
			line-height: 22px;
			text-align: left;
			margin-right: 10px;
		}

		.line-content {
			flex-grow: 1;
			flex-shrink: 1;
			display: flex;
			flex-direction: row;
			align-items: center;
		}

		.ipt {
			//     width: 368px;
			width: 100%;
			height: 32px;

			::v-deep .el-input__inner {
				width: 100%;
				height: 32px;
			}

			::v-deep .el-input__inner:focus {
				border: 1px solid #dcdfe6;
			}

			::v-deep .el-input__icon {
				line-height: 32px;
				color: #909399;
			}

			::v-deep .el-input__suffix {
				width: 32px;
				right: 0;
				background: #dee0e3;
			}
		}

		.picker {
			width: 130px;
			margin: 0px 10px;

			::v-deep .el-input__inner {
				width: 130px;
			}

			::v-deep .el-input__suffix {
				background: transparent;
			}
		}

		.divider {
			width: 100%;
			height: 1px;
			background-color: #f0f0f0;
		}
	}

	.right-line.bottom-border {
		padding-bottom: 10px;
		// border-bottom: 1px solid #f0f0f0;
	}

	.flex-row {
		flex-direction: row;
	}

	.flex-column {
		flex-direction: column;
	}
}

.split-title {
	width: 100%;
	font-size: 16px;
	font-weight: 700;
	color: rgba(0, 0, 0, 0.85);
	line-height: 22px;
	padding: 12px 12px;
	border-bottom: 1px solid #f0f0f0;
}

.footer-view {
	width: calc(100% - 30px);
	box-sizing: border-box;
	position: absolute;
	z-index: 10;
	bottom: 16px;
	// padding: 0 15px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	// background-color: red;
	padding-top: 17px;
	border-top: 1px solid #f0f0f0;
	font-size: 16px;
	font-weight: 700;

	button {
		width: 82px !important;
		height: 32px;
		// background: #ffffff;
		// border: 1px solid #d9d9d9;
		margin-left: 12px;
		border-radius: 4px;
		font-size: 14px;
		font-weight: 500;
		line-height: 0;
	}

	button:nth-child(2) {
		// background: #106ebe;
		// color: #fff;
	}
}

#right-CAD {
	width: 1207px;
	height: 680px;
	position: fixed;
	top: -200vh;
	// top: 0;
	left: 0;
	z-index: -999;
}
</style>
